package com.xj.demo.entity;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.TypeAlias;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * <p> 博客实体类 </p>
 *
 * @author xujj
 * @description
 * @date 2024/4/6 16:48
 */
@Data
@TypeAlias("blog")
@Document(indexName = "blog")
public class EsBlog {

    @Id
    private String id;

    /**
     * 博客类型
     */
    @Field(type = FieldType.Keyword)
    private Integer type;
    /**
     * 博客标题
     */
    @Field(type = FieldType.Keyword)
    private String title;
    /**
     * 博客简介
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String summary;
    /**
     * 博客内容
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String content;
}

